package com.hyh.monitor;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import com.hyh.gumballmachine.GumballMachine;
import com.hyh.remote.MyRemote;

public class GumballMachineMonitor extends UnicastRemoteObject implements MyRemote {

	private GumballMachine gumballMachine;
	
	public GumballMachineMonitor(GumballMachine gumballMachine) throws RemoteException {
		this.gumballMachine = gumballMachine;
	}
	
	public boolean report(){
		System.out.println(gumballMachine.getCount());
		System.out.println(gumballMachine.getState());
		return true;
	}
}
